package com.realtyManage.springboot.Controller;

import com.alibaba.fastjson.JSON;
import com.realtyManage.springboot.Model.Do.SysLog;
import com.realtyManage.springboot.Model.Vo.SysLogEntity;
import com.realtyManage.springboot.Service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/log")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    /**
     * 查询日志信息
     * @param entity
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/showSysLogList",method = RequestMethod.GET)
    private String showSysLogList(SysLogEntity entity, HttpServletRequest request) {
        Page<SysLog> sysLogList = sysLogService.findPagedByWhereClause(entity);
        return JSON.toJSONString(sysLogList);
    }

}
